package mysql

import (
	"gorm.io/gorm"
)

type Shop struct {
	gorm.Model
	Title   string  `gorm:"type:varchar(30);not null;comment: 标题"`
	Price   float64 `gorm:"type:decimal(10,2);not null;comment: 价格"`
	Address string  `gorm:"type:varchar(30);not null;comment: 地址"`
	ClassID int     `gorm:"type:int(30);not null;comment: 分类ID"`
}

/*
func (s *Shop) ShopList(db *gorm.DB) ([]*hipporpc.ShopList, error) {

	var shop []*hipporpc.ShopList

	err2 := db.Debug().Model(&Shop{}).Select(
		"shops.title",
		"shops.price",
		"shops.address",
		"shops.classId",
	).Find(&shop).Error

	return shop, err2

}
*/
type Class struct {
	gorm.Model
	Name string `gorm:"type:varchar(30);not null;comment: 分类名称"`
}
